using UnityEngine;

namespace Client.Base
{
    public enum UILayer
    {
        Patch,
        Login,
        Game,
        Loading,
        Guide,
        Tips,
        Cover
    }
    public class UIRoot : MonoBehaviour
    {
        public static UIRoot Instance;
        [SerializeField] private Camera UICamera;
        [SerializeField] private Transform Canvas_Patch;
        [SerializeField] private Transform Canvas_Login;
        [SerializeField] private Transform Canvas_Game;
        [SerializeField] private Transform Canvas_Loading;
        [SerializeField] private Transform Canvas_Guide;
        [SerializeField] private Transform Canvas_Tips;
        [SerializeField] private Transform Canvas_Cover;
        public void Awake()
        {
            Instance = this;
        }

        public Camera GetUICamera() => UICamera;

        public Transform GetLayer(UILayer layer)
        {
            switch (layer)
            {
                case UILayer.Patch: return Canvas_Patch;
                case UILayer.Login: return Canvas_Login;
                case UILayer.Game: return Canvas_Game;
                case UILayer.Loading: return Canvas_Loading;
                case UILayer.Guide: return Canvas_Guide;
                case UILayer.Tips: return Canvas_Tips;
                case UILayer.Cover: return Canvas_Cover;
                default:
                    this.LogYellow($"uiroot not exist layer:{layer}");
                    return null;
            }
        }
    }

}
